package IOPeration;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class Findbook implements Ioperation {
    public void work(BookList bookList){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入你要查找的书名");
        String name=scanner.nextLine();
        int currenTsize= bookList.getUsedsize();
        for(int i=0;i<currenTsize;i++){
            Book book=bookList.getBooks(i);
            if(book.getName().equals(name)){
                System.out.println("找到了您要找的书了");
                return;
            }

        }
      System.out.println("没有你要找的书");

    }
}
